from selenium import webdriver
import time
import os
from selenium.webdriver.common.action_chains import ActionChains

driver = webdriver.Chrome()
url = "file:///"+os.path.abspath("C:\\课件\\我的课件\\测试\\selenium2/locateElement/selenium2html/level_locate.html")
driver.get(url)

driver.maximize_window()
# 定位link1，点击
driver.find_element_by_link_text("Link1").click()
driver.implicitly_wait(10)
# 定位 Another Action
action = driver.find_element_by_link_text("Another action")
# 高亮显示Another action， 把鼠标移动到 Another action上面
ActionChains(driver).move_to_element(action).perform()

time.sleep(6)
driver.quit()
